package com.burns.svg.demo;/**
 * Created by burns.
 *
 * @author <a href="http://www.esoon-soft.com/">burns</a>
 * @date 2021/04/25 11:45
 */

import org.w3c.dom.Element;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;
import org.w3c.dom.events.EventTarget;
import org.w3c.dom.svg.EventListenerInitializer;
import org.w3c.dom.svg.SVGDocument;

/**
 * TODO
 *
 * @ClassName SvgElementListenerDemo
 * @Author Burns
 * @DAte 2021/4/25 11:45
 */
public class EventListenerInit implements EventListenerInitializer {
    @Override
    public void initializeEventListeners(SVGDocument doc) {

        //JCT Windows SHOW
        ((EventTarget) doc.getElementById("testJCT")).
                addEventListener("click", new EventListener() {
                    @Override
                    public void handleEvent(Event evt) {

                        ((Element) evt.getTarget()).setAttributeNS(null, "fill", "orange");
//                        subwindws sw = new subwindws(evt);
//                        sw.show();
                    }
                }, false);
    }
}

